<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<c:set var="ctx" value="<%=basePath%>" />
<!DOCTYPE HTML >
<html>
  <head>
    <base href="<%=basePath%>">
    <title>开始透析</title>
    <meta charset="utf-8" />
    <meta name="format-detection" content="telephone=no">
    <meta content="yes" name="apple-touch-fullscreen"> 
    <meta name="apple-mobile-web-app-capable" content="yes"> 
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />    
	<meta http-equiv="keywords" content="云净,透析单,网页透析" />
	<meta http-equiv="description" content="云净透析单" />
	<link href="${ctx}image/yunjing/logo.ico" type="image/x-icon" rel="shortcut icon">
	<link rel="stylesheet" type="text/css" href="${ctx}bootstrap/css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="${ctx}css/weui/weui.css" />
	<link rel="stylesheet" type="text/css" href="${ctx}css/yunjing/mtxform.css?v=201708311653" />
	<style>
	   .page_info_lable{width: 100px;}
	  .head_confirm{font-size: 16px;color: #3da2ee;float: right;}
	  .head_confirm_time{font-size: 16px;font-weight: bold;}
	  .local_modal_confirm_button {
	    color: #0ACCDD;
	    background-color: #FFFFFF;
	  }
	  .page_scroll_hour{
	    display:inline-block;
	    height: 180px;
	    overflow: scroll;
	    margin-right: 40px;
	    width: 60px;
	  }
	  .page_scroll_hour>li{
	    color: #777777;
	    padding: 8px;
	    list-style-type: none;
	  }
	  .page_scroll_minute{
	    display:inline-block;
	    height: 180px;
	    overflow: scroll;
        width: 60px;
	  }
	 .page_scroll_minute>li{
	    color: #777777;
	    padding: 8px;
	    list-style-type: none;
	 }
	 .page_select_time{
	    width: 123px;
	    text-align: right;
	    color: #777777;
        font-size: 16px;
        line-height: 30px;
        padding-right: 16px;
	 }
	 .sp_top{
	  position: absolute;top: 70px;border-bottom: 1px solid #ddd;width: 100%
	 }
	  .sp_bottom{
	  position: absolute;top: 110px;border-bottom: 1px solid #ddd;width: 100%
	 }
	 
	 ul::-webkit-scrollbar{
	  display: none;
	 }
	 .scroll_li_active{color: black !important;font-weight: bold;}
	 .word_confirm_btn{border: 0px;background: none;}
	 .local_modal_confirm_div {
	    text-align: center;
	    padding-bottom: 20px;
	    padding-top: 20px;
     }
     
	</style>
  </head>
  <body>
   <div class="page_header ">
        <div class="page_header_module">
           <a href="javascript:void(0);" onclick="window.location.href='${ctx}txform/mtxform.shtml'" class="back_a" style="font-size: 16px;" >
           <img src="image/yunjing/mtxform/goback.png" style="width: 20px;" alt="返回" class="back_pic" />返回
           </a>   
        </div>     
        <div class="page_header_module">
           <span class="head_confirm_time">开始透析时间</span>
        </div>
        <div class="page_header_module"><button type="button" class="head_confirm word_confirm_btn" >确认</button></div>
   </div>
  
  <form class="tx_from_begin" id="tx_form">
    <input name="tx_number" type="hidden"  value="${param.tx_number}" />
    <input name="tx_time" type="hidden"  value="${param.tx_time}" />
    <input name="tx_zlxj_id" type="hidden"  value="${txzlxj.tx_zlxj_id}" />
    <input name="tx_zl_doctor" type="hidden"  value="${txzlxj.tx_zl_doctor}" />
    <input name="tx_zl_doctor_id" type="hidden"  value="${txzlxj.tx_zl_doctor_id}" />
   <table class="table table_info">
	   <tr>
	    <td align="right">
	      <div class="page_select_time page_info_lable">时间</div>
	    </td>
	    <td colspan="2" align="left">
	       <div class="page_info">
	          <input type="text" class="info_input" name="tx_start_time_hi" value="" placeholder="请滚动选择/输入"  />
	          <input type="hidden" class="info_input" name="tx_start_time" value=""  />
	       </div>
	    </td>
	   </tr>
	   
	   <tr>
	    <td colspan="3">
	      <div style="margin: 0 auto;text-align: center;position: relative;">
	          <div class="sp_top" ></div><div class="sp_bottom" ></div>
		      <ul class="page_scroll_hour" >
		       <li>01时</li> <li>02时</li> <li>03时</li> <li>04时</li> <li>05时</li>  <li>06时</li>
		       <li>07时</li> <li>08时</li> <li>09时</li> <li>10时</li> <li>11时</li>  <li>12时</li>
		       <li>13时</li> <li>14时</li> <li>15时</li> <li>16时</li> <li>17时</li> <li>18时</li>
		       <li>19时</li> <li>20时</li> <li>21时</li> <li>22时</li> <li>23时</li> <li>00时</li>
		      </ul>
		      <ul class="page_scroll_minute">
		         <li>01分</li><li>02分</li><li>03分</li><li>04分</li><li>05分</li><li>06分</li><li>07分</li><li>08分</li><li>09分</li><li>10分</li>
		         <li>11分</li><li>12分</li><li>13分</li><li>14分</li><li>15分</li><li>16分</li><li>17分</li><li>18分</li><li>19分</li><li>20分</li>
		         <li>21分</li><li>22分</li><li>23分</li><li>24分</li><li>25分</li><li>26分</li><li>27分</li><li>28分</li><li>29分</li><li>30分</li>
		         <li>31分</li><li>32分</li><li>33分</li><li>34分</li><li>35分</li><li>36分</li><li>37分</li><li>38分</li><li>39分</li><li>40分</li>
		         <li>41分</li><li>42分</li><li>43分</li><li>44分</li><li>45分</li><li>46分</li><li>47分</li><li>48分</li><li>49分</li><li>50分</li>
		         <li>51分</li><li>52分</li><li>53分</li><li>54分</li><li>55分</li><li>56分</li><li>57分</li><li>58分</li><li>59分</li><li>00分</li>
		      </ul>
	      </div>
	    </td>
	   </tr>	
		
	   <tr>
	     <td align="right"><div class="page_info_lable">治疗护士</div></td>
	     <td class="select_page">
	       <div class="page_info">
	        <input type="hidden" class="info_input_id" name="tx_zl_nurse_id" value="${txzlxj.tx_zl_nurse_id}" />
	        <input type="text" class="info_input"  name="tx_zl_nurse" value="${txzlxj.tx_zl_nurse}" readonly="readonly" placeholder="请选择"  />
	       </div>
	     </td>
	     <td align="right" class="select_page"><a href="javascript:void(0);"  title="tx_hs" ><img src="image/yunjing/mtxform/right_gray.png" class="modal_select_arrows" alt="选择" /></a></td>
	   </tr>
		
	   <tr>
	     <td align="right" ><div class="page_info_lable">穿刺/换药</div></td>
	     <td class="local_check_page">
	       <div class="page_info"><input type="text" class="info_input"  name="tx_fs" value="" readonly="readonly" placeholder="请选择"  /> </div>
	     </td>
	     <td align="right" class="local_check_page"><a href="javascript:void(0);" ><img src="image/yunjing/mtxform/right_gray.png" class="modal_select_arrows" alt="选择" /></a></td>
	   </tr>	
		
	   <tr class="tx_common hidden" >
	     <td align="right" ><div class="page_info_lable tx_hs">穿刺护士</div></td>
	     <td class="select_page">
	       <div class="page_info">
	        <input type="hidden" class="info_input_id" name="tx_sj_nurse_id" value="${txzlxj.tx_sj_nurse_id}" />
	        <input type="text" class="info_input"  name="tx_sj_nurse" value="${txzlxj.tx_sj_nurse}" readonly="readonly" placeholder="请选择"  />
	       </div>
	     </td>
	     <td align="right" class="select_page"><a href="javascript:void(0);"  title="tx_hs" ><img src="image/yunjing/mtxform/right_gray.png" class="modal_select_arrows" alt="选择" /></a></td>
	   </tr>
	    
	   <tr class="tx_cc hidden">
	     <td align="right" ><div class="page_info_lable">穿刺方式</div></td>
	     <td class="check_page">
	       <div class="page_info"><input type="text" class="info_input"  name="tx_ccfs" value="${txzlxj.tx_ccfs}" readonly="readonly" placeholder="请选择"   /> </div>
	     </td>
	     <td align="right" class="check_page"><a href="javascript:void(0);"  title="tx_ccfs" ><img src="image/yunjing/mtxform/right_gray.png" class="modal_select_arrows" alt="选择" /></a></td>
	   </tr> 
	    
	    <tr class="tx_cc hidden">
	     <td align="right" ><div class="page_info_lable">穿刺针</div></td>
	     <td class="check_page">
	       <div class="page_info"><input type="text" class="info_input"  name="tx_ccz" value="${txzlxj.tx_ccz}" readonly="readonly" placeholder="请选择"  /> </div>
	     </td>
	     <td align="right" class="check_page"><a href="javascript:void(0);"  title="tx_ccz" ><img src="image/yunjing/mtxform/right_gray.png" class="modal_select_arrows" alt="选择" /></a></td>
	   </tr> 
	   
	   <tr class="hidden tx_ccfx tx_new">
	     <td align="right" ><div class="page_info_lable">A端穿刺方向</div></td>
	     <td class="select_page">
	       <div class="page_info"><input type="text" class="info_input"  name="tx_ccfx" value="${txzlxj.tx_ccfx}" readonly="readonly" placeholder="请选择"  /> </div>
	     </td>
	     <td align="right" class="select_page"><a href="javascript:void(0);"  title="tx_ccfx" ><img src="image/yunjing/mtxform/right_gray.png" class="modal_select_arrows" alt="选择" /></a></td>
	   </tr> 
	   
	   <tr class="tx_tlpic tx_new">
	     <td align="right"  ><div class="page_info_lable">通路图片</div></td>
	     <td class="xgtl_pic_page">
	       <div class="page_info" id="viewMarkPic">点击查看</div>
	     </td>
	     <td align="right" class="xgtl_pic_page" ><a href="javascript:void(0);"  ><img src="image/yunjing/mtxform/right_gray.png" class="modal_select_arrows" alt="选择" /></a></td>
	   </tr> 
	   
	   <tr class="hidden tx_ccwd tx_new">
	     <td align="right" ><div class="page_info_lable">穿刺位点</div></td>
	     <td class="xgtl_ccwd_page">
	       <div class="page_info">
	         <input type="hidden" class="info_input"  name="tx_ccwd_a" id="selectMark_a" value="${txzlxj.tx_ccwd_a}" readonly="readonly" placeholder="请选择"  />
	         <input type="hidden" class="info_input"  name="tx_ccwd_v" id="selectMark_v" value="${txzlxj.tx_ccwd_v}" readonly="readonly" placeholder="请选择"  /> 
	         <input type="text" class="info_input"  name="tx_ccwd" id="selectMark_show" value="" readonly unselectable="on" onfocus="this.blur()" placeholder="请选择"  /> 
	       </div>
	     </td>
	     <td align="right" class="xgtl_ccwd_page"><a href="javascript:void(0);"  title="" ><img src="image/yunjing/mtxform/right_gray.png" class="modal_select_arrows" alt="选择" /></a></td>
	   </tr> 
			    
	   <tr><td colspan="3"></td></tr>
   </table>
  </form>  
 
  <div class="modal fade" id="select_Modal" role="dialog" style="display:none;" >
       <input type="hidden" name="input_type"  value=""   />
       <input type="hidden" name="input_name"  value=""  />
       <input type="hidden" name="input_id"  value=""  />
       <input type="hidden" name="input_val"  value=""  />
       <input type="hidden" name="info_lable"  value=""  />
       <input type="hidden" name="dic_type"  value=""  />
       <input type="hidden" name="define_type"  value=""  />
       <div class="weui-cells weui-cells_radio modal_container">
         <table class="table table_info page_fixed_head_table">
		   <tr class="">
		     <td class="col-xs-4" align="left">
		          <a href="javascript:void(0);"  class="" data-dismiss="modal" >
		           <img src="image/yunjing/mtxform/goback.png"  alt="返回" class=""  />
		          </a>
		     </td> 
		     <td class="col-xs-4" align="center"><span class="back_title">开始透析</span></td>
		     <td class="col-xs-4" align="right"><a href="javascript:void(0);"  class="modal_confirm_div" onclick=""><span class="back_save">保存</span></a></td>
		   </tr>
		   <tr><td colspan="3"><div class="modal_type_tittle"></div></td></tr>
	     </table>
         <div class="modal_content"></div> 
      </div>
  </div>
  
  <div class="modal fade" id="select_local_modal" role="dialog"  >
     <input type="hidden" name="local_input_name"  value=""  />
     <input type="hidden" name="local_input_val"  value=""  />
     <div class="weui-cells weui-cells_radio modal_container">
         <table class="table table_info page_fixed_head_table">
		   <tr class="">
		     <td class="col-xs-4" align="left">
		          <a href="javascript:void(0);"  class="" data-dismiss="modal" >
		           <img src="image/yunjing/mtxform/goback.png"  alt="返回" class=""  />
		          </a>
		     </td> 
		     <td class="col-xs-4" align="center"><span class="back_title">开始透析</span></td>
		     <td class="col-xs-4" align="right"><a href="javascript:void(0);"  class="local_modal_confirm_button" onclick=""><span class="back_save">保存</span></a></td>
		   </tr>
	     </table> 
          <div class="local_modal_content" style="margin-top: 50px;">
	          <button type="button"  data-id="0"   data-name="穿刺" class="btn btn-default btn_common" onclick="selectone(this);" >穿刺</button>
	          <button type="button"  data-id="1"   data-name="换药" class="btn btn-default btn_common" onclick="selectone(this);" >换药</button>
          </div> 
      </div>
  </div>
 
   <ul class="page_scroll_hour_add" style="display: none;" >
       <li class="li_add">01时</li> <li class="li_add">02时</li> <li class="li_add">03时</li> <li class="li_add">04时</li> <li class="li_add">05时</li>  <li class="li_add">06时</li>
       <li class="li_add">07时</li> <li class="li_add">08时</li> <li class="li_add">09时</li> <li class="li_add">10时</li> <li class="li_add">11时</li>  <li class="li_add">12时</li>
       <li class="li_add">13时</li> <li class="li_add">14时</li> <li class="li_add">15时</li> <li class="li_add">16时</li> <li class="li_add">17时</li> <li class="li_add">18时</li>
       <li class="li_add">19时</li> <li class="li_add">20时</li> <li class="li_add">21时</li> <li class="li_add">22时</li> <li class="li_add">23时</li> <li class="li_add">00时</li>
   </ul> 
   
    <ul class="page_scroll_minute_add" style="display: none;">
       <li>01分</li><li>02分</li><li>03分</li><li>04分</li><li>05分</li><li>06分</li><li>07分</li><li>08分</li><li>09分</li><li>10分</li>
       <li>11分</li><li>12分</li><li>13分</li><li>14分</li><li>15分</li><li>16分</li><li>17分</li><li>18分</li><li>19分</li><li>20分</li>
       <li>21分</li><li>22分</li><li>23分</li><li>24分</li><li>25分</li><li>26分</li><li>27分</li><li>28分</li><li>29分</li><li>30分</li>
       <li>31分</li><li>32分</li><li>33分</li><li>34分</li><li>35分</li><li>36分</li><li>37分</li><li>38分</li><li>39分</li><li>40分</li>
       <li>41分</li><li>42分</li><li>43分</li><li>44分</li><li>45分</li><li>46分</li><li>47分</li><li>48分</li><li>49分</li><li>50分</li>
       <li>51分</li><li>52分</li><li>53分</li><li>54分</li><li>55分</li><li>56分</li><li>57分</li><li>58分</li><li>59分</li><li>00分</li>
    </ul>
    <div id="view-markpic-wrap" style="display:none;">
        <style scoped>
            div#view-markpic-wrap .shadow{
                position: fixed;
                height: 100vh;
                width: 100vw;
                left: 0px;
                top: 0px;
                z-index: 9;
                opacity: 0.42;
                background: #000;
            }
            div#view-markpic-wrap {
                position: fixed;
                height: 100vh;
                width: 100vw;
                left: 0px;
                top: 0px;
                z-index: 10;
                overflow-y:auto;
                /* display: flex;
                justify-content: center;
                align-items: center; */
            }
            #markpicWarp2{
                position: absolute;
				left:50%;
				top:60px;
				width:92%;
				z-index:10;
				min-height:30vh;
				border-radius:4px;
				background: rgba(205, 212, 215, 0.15);
				display: flex;
                justify-content: center;
                align-items: center;
                transform: translate(-50%, 0);
            }
            #markpicWarp2 span.close-view-img{
                position: absolute;
                width:32px;
                height:32px;
                line-height: 32px;
                text-align:center;
                z-index:11;
                top:20px;
                left: 18px;
                font-size:22px;
                color: #f85b71;
                border: 2px solid #f85b71;
    			border-radius: 50%;
                opacity: 0.83;
                font-weight: 600;
                cursor: pointer;
                display: inline-flex;
			    justify-content: center;
			    align-items: center;
			    padding-bottom: 2px;
			    background: #fff;
            }
            
            /* 位点图片S  */
            #point_mark_img_wrap1{
	        	border:1px solid #ddd;
	        	border-radius:2px;
	        	min-height:30vh;
	        	position:relative;
	        	width:100%;
	        	padding:4px;
	        	background:#fff;
	        }
	        #point_mark_img_wrap1 img{
	        	border-radius:2px;
	        	width:100%;
	        	height:auto;
	        	left:0;
	        	right:0;
	        }
	        div.mark-target-a,div.mark-target-v {
			    background: #BABABA;
			    left: 40px;
			    z-index: 1001;
			    width: 32px;
			    border-radius: 16px;
			    height: 32px;
			    text-align: center;
			    line-height: 32px;
			    font-size:15px;
			    cursor: move;
			    color: #FBFBFB;
			}
			
	  		div.mark-target-a{
				background: #E73535;
				color:#fff;
			}
			div.mark-target-v{
				background: rgb(53, 162, 231);
				color:#fff;
			}
			div.mark-target-a span.mark-line{
	  			transform: rotate(30deg);
	  			background: #BABABA;
	  		}
	        div.mark-target-v span.mark-line {
			    transform: rotate(150deg);
			    background: #BABABA;
			}
			div.mark-target-a span.mark-line{
	  			background: #E73535;
	  		}
			div.mark-target-v span.mark-line {
			    background: #35A2E7;
			}
			span.mark-line {
			    display: inline-block;
			    position: absolute;
			    left: 50%;
			    top: 50%;
			    width: 86px;
			    height: 1px;
			    z-index: -1;
			    transform-origin: left bottom;
			}
			
			div.add-mark-text-wrap{
	  			position:absolute;
	  			border-radius: 4px;
	  			min-width:60px;
	  			min-height:28px;
	  			z-index:1000;
	  			display:inline-block;
	  			border-radius:4px;
	  			opacity:0.82;
	  		}
	  		div.add-mark-text-wrap .mark-text-line{
	  			display: inline-block;
			    position: absolute;
			    left: 50%;
	    		top: 50%;
			    width: 106px;
			    height: 1px;
			    background-color: #575757;
			    z-index: -1;
			    transform-origin: left bottom;
	  		}
	  		/* div.add-mark-text-wrap{
	  			box-shadow:2px 3px 8px rgba(0,0,0,.2), -3px -2px 8px rgba(0,0,0,.2);
	  		} */
	  		div.add-mark-text-wrap input{
	  			min-width:60px;
	  			width:auto;
	  			max-width:200px;
	  			border:0 !important;
	  			color:#333;
	  			height: 28px;
	  			cursor: default;
	  			background-color:#f9fbfb;
	  			position:absolute;
	  			left:0;
	  			top:0;
	  			font-size: 13px;
	  			z-index:1002;
	  			padding-left:2px;
	  			border-radius: 2px;
	  		}
	  		/* 位点图片E  */
	  		.close-view-img_,.modal_confirm_div,.xgtl_ccwd_page{
	  			cursor: pointer;
	  		}
	  		.scroll-wrapper {  
			    -webkit-overflow-scrolling: touch;  
			    overflow-y: scroll;  
			}
        </style>
        <div class="shadow"></div>
        <div id="markpicWarp2">
        	<div id="point_mark_img_wrap1"><img src="" alt="血管通路图片"></div>
            <div class="close-view-img_" style="position:absolute;right:-14px;top:-40px;padding:20px;width:52px;height:52px;"><span class="close-view-img">×</span></div>
        </div>
    </div>
  </body>
  <style>

  </style>
  <script type="text/javascript" src="${ctx}js/jquery/jquery-1.9.1.min.js"></script>
  <script type="text/javascript" src="${ctx}js/layer/layer.js"></script>
  <script type="text/javascript" src="${ctx}bootstrap/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="${ctx}js/yunjing/mtxform.js?v=201704121759"></script>
  <script type="text/javascript" src="js/common/common.js"></script>
  <script type="text/javascript" src="js/jquery/mobile/jquery.mobile.custom.min.js"></script>
  <script>
  $(function(){
   //默认护士
   if($("input[name='tx_zl_nurse']").val()==""){
     if(${userinfo.USER_PERMISSION==3||userinfo.USER_PERMISSION==4}){
        $("input[name='tx_zl_nurse']").val("${userinfo.USER_NAME}");
        $("input[name='tx_zl_nurse_id']").val("${userinfo.USER_ID}");
      }
    }
   if($("input[name='tx_sj_nurse']").val()==""){
     if(${userinfo.USER_PERMISSION==3||userinfo.USER_PERMISSION==4}){
        $("input[name='tx_sj_nurse']").val("${userinfo.USER_NAME}");
        $("input[name='tx_sj_nurse_id']").val("${userinfo.USER_ID}");
     }
   }
   //默认上次的穿刺/换药
   if("${lastzlxj.tx_ccfs}"!=""||"${lastzlxj.tx_ccz}"!=""){
       $("input[name='tx_fs']").val("穿刺");
       $("input[name='tx_ccfs']").val("${lastzlxj.tx_ccfs}");
       $("input[name='tx_ccz']").val("${lastzlxj.tx_ccz}");
       $("tr.tx_common").removeClass("hidden");
	   $("tr.tx_cc").removeClass("hidden");$("div.tx_hs").text("穿刺护士");
	   //判断是穿刺方式是否包含 绳梯法
      if("${lastzlxj.tx_ccfs}".indexOf("绳梯法")>=0){
		   $("tr.tx_tlpic").addClass("hidden");
           $("tr.tx_ccfx").removeClass("hidden");
           $("tr.tx_ccwd").removeClass("hidden");
		 }else{
		   $("tr.tx_ccwd").addClass("hidden");
           $("tr.tx_ccfx").removeClass("hidden");
           $("tr.tx_tlpic").removeClass("hidden");
	   } 
   }else{
       $("input[name='tx_fs']").val("换药");
       $("tr.tx_common").removeClass("hidden");
	   $("tr.tx_cc").addClass("hidden");$("div.tx_hs").text("换药护士");
   }
   
    //默认滚动到当前时间
    var date = new Date();
    var h=date.getHours();
    var m=date.getMinutes();
    if(h>3){$(".page_scroll_hour").scrollTop((h-3)*36);}else{
        $(".page_scroll_hour").prepend($("ul.page_scroll_hour_add").html());
        $(".page_scroll_hour").scrollTop((h+21)*36);
    }
    if(m>3){$(".page_scroll_minute").scrollTop((m-3)*36);}else{
        $(".page_scroll_minute").prepend($("ul.page_scroll_minute_add").html());
        $(".page_scroll_minute").scrollTop((m+57)*36); 
        
    }
    $("input[name='tx_start_time_hi']").val(getNowHiDate());  
    
  
   $(".local_check_page").click(function(){ 
      var $ele=$(this).parent("tr").find("input");
      $("input[name='local_input_name']").val($ele.attr("name"));
      $("div.local_modal_content").find("button.btn_common[data-name='"+$ele.val()+"']").addClass("btn_active");
      $("#select_local_modal").modal("show");
   });
   
   $("#select_local_modal").on("click",".local_modal_confirm_button",function(){
       var va=$("div.local_modal_content").find('button.btn_active').text();      //如果是单选
	   $("input[name='"+$("input[name='local_input_name']").val()+"']").val(va);//设置保存的input的值为选中的值
	   if(va=="穿刺"){
	      $("tr.tx_common").removeClass("hidden");
	      $("tr.tx_cc,tr.tx_ccfx").removeClass("hidden");$("div.tx_hs").text("穿刺护士");
	      $("input[name='tx_ccfs']").attr("disabled",false);
	      $("input[name='tx_ccz']").attr("disabled",false);
	      if($("input[name='tx_ccfs']").val().indexOf("绳梯法")>=0){
	      	$("tr.tx_ccwd").removeClass("hidden")
	      }else{
	      	$("tr.tx_tlpic").removeClass("hidden")
	      }
	   }
	   if(va=="换药"){
	      $("tr.tx_common").removeClass("hidden");
	      $("tr.tx_cc,tr.tx_ccwd,tr.tx_ccfx,tr.tx_tlpic").addClass("hidden");$("div.tx_hs").text("换药护士");
	      $("input[name='tx_ccfs']").attr("disabled","disabled");
	      $("input[name='tx_ccz']").attr("disabled","disabled");
	   }
       $("#select_local_modal").modal('hide');	 
   });
	
   // 进入页面判断一次显示穿刺或者换药的选项
   function tabViewCcHy(){
   	  var va = $("input[name='tx_fs']").val();      
	   if(va=="穿刺"){
	      $("tr.tx_common").removeClass("hidden");
	      $("tr.tx_cc,tr.tx_ccfx").removeClass("hidden");$("div.tx_hs").text("穿刺护士");
	      if($("input[name='tx_ccfs']").val().indexOf("绳梯法")>=0){
	      	$("tr.tx_ccwd").removeClass("hidden")
	      	$("tr.tx_tlpic").addClass("hidden")
	      }else{
	      	$("tr.tx_tlpic").removeClass("hidden")
	      	$("tr.tx_ccwd").addClass("hidden")
	      }
	   }
	   if(va=="换药"){
	      $("tr.tx_common").removeClass("hidden");
	      $("tr.tx_cc,tr.tx_ccwd,tr.tx_ccfx,tr.tx_tlpic").addClass("hidden");$("div.tx_hs").text("换药护士");
	      $("input[name='tx_ccfs']").val("");
	      $("input[name='tx_ccz']").val("");
	      $("input[name='tx_ccfx']").val("");
          $("input[name='tx_ccwd_a']").val("");
          $("input[name='tx_ccwd_v']").val("");
          $("input[name='tx_ccwd']").val("");
	   }
   }
   tabViewCcHy()
	
   //保存数据
   $(".head_confirm").click(function(){
     var tx_fs=$("input[name=tx_fs]").val();
     if(""==tx_fs){layer.msg("穿刺/换药不能为空！");return false;}
     if(""==$("input[name=tx_zl_nurse]").val()){layer.msg("治疗护士不能为空！");return false;}
     if(""==$("input[name=tx_sj_nurse]").val()){layer.msg("穿刺/换药护士不能为空！");return false;}
     if(""==$("input[name=tx_ccfs]").val()&&tx_fs=="穿刺"){layer.msg("穿刺方式不能为空！");return false;}
     if(""==$("input[name=tx_ccz]").val()&&tx_fs=="穿刺"){layer.msg("穿刺针不能为空！");return false;}
     //校验时间格式
     var hi=$("input[name='tx_start_time_hi']").val();
     if(!checkhi(hi)){layer.msg("时间格式不正确！");return false;}
     $("input[name='tx_start_time']").val(getNowymdDate()+" "+hi);  
     var form_data= $("#tx_form").serializeArray();
     $.ajax({
         type:"post",
         data:form_data,
         async:false,
         url:"txform/mtxform_txbegin.shtml",
         dataType:"json",
         beforeSend:function(){
            $(".head_confirm").attr("disabled","disabled");
         },
         success:function(data,status){
          if(data['status']==""){
            layer.msg("开始透析成功！");
            //var tx_jcjl_ymd=getNowymdDate();
            window.location.href="${ctx}txform/mtxform_hzjcjl_detail.shtml?id="+data.jcjlid+"&tx_number=${param.tx_number}&tx_name=${param.tx_name}&tx_time=${param.tx_time}&tx_jcjl_ymd="+getNowymdDate();
            //setTimeout("window.location.href='${ctx}txform/mtxform_hzjcjl_detail.shtml?id="+data.jcjlid+"&tx_number=${param.tx_number}&tx_name=${param.tx_name}&tx_time=${param.tx_time}&tx_jcjl_ymd="+tx_jcjl_ymd+"'",2000) 
            // $(".back_a").trigger("click");
           }else{layer.alert(data.status);}
          },error:function(){
             $(".head_confirm").removeAttr("disabled");
             layer.msg("保存出错，请检查数据！"); 
          },complete:function(){
             //$(".head_confirm").removeAttr("disabled");
          }
      });  
   });
   
   
   $("ul.page_scroll_hour").on("scrollstop",function(){
      //console.log("滚动结束："+$(".page_scroll_hour").scrollTop());
      var d_top=$(".page_scroll_hour").scrollTop();
      //console.log(d_top%36+"___"+parseInt(d_top/36));
      if(d_top%36<=18){$(".page_scroll_hour").scrollTop(parseInt(d_top/36)*36);}else{$(".page_scroll_hour").scrollTop((parseInt(d_top/36)+1)*36);}
      //判断是否拖到顶部或者底部
      if(parseInt(d_top/36)>=19){
        $(".page_scroll_hour").append($("ul.page_scroll_hour_add").html());
      }else{
        $(".page_scroll_hour").prepend($("ul.page_scroll_hour_add").html());
        $(".page_scroll_hour").scrollTop((parseInt(d_top/36)+24)*36);
      } 
      //console.log("hour:"+(parseInt(d_top/36)+3)%24);
      var nth=parseInt(d_top/36)+3;
      //console.log(nth,d_top,d_top/36,new Date(),new Date().getTime())
      $("ul.page_scroll_hour li:nth-child("+nth+")").addClass("scroll_li_active").siblings().removeClass("scroll_li_active");
      var tx_start_time=$("input[name='tx_start_time_hi']").val();var h=(parseInt(d_top/36)+3)%24;
      $("input[name='tx_start_time_hi']").val((h<10?"0"+h:h)+":"+tx_start_time.split(":")[1]);  
   });
   
   $("ul.page_scroll_minute").on("scrollstop",function(){
      //console.log("滚动结束："+$(".page_scroll_minute").scrollTop());
      var d_top=$(".page_scroll_minute").scrollTop();
      //console.log(d_top%36+"___"+parseInt(d_top/36));
      if(d_top%36<=18){$(".page_scroll_minute").scrollTop(parseInt(d_top/36)*36);}else{$(".page_scroll_minute").scrollTop((parseInt(d_top/36)+1)*36);}
      //判断是否拖到顶部或者底部
      if(parseInt(d_top/36)>=19){
        $(".page_scroll_minute").append($("ul.page_scroll_minute_add").html());
      }else{
        $(".page_scroll_minute").prepend($("ul.page_scroll_minute_add").html());
        $(".page_scroll_minute").scrollTop((parseInt(d_top/36)+60)*36);
      } 
      //console.log("min:"+(parseInt(d_top/36)+3)%60);
      var nth=parseInt(d_top/36)+3;      
      $("ul.page_scroll_minute li:nth-child("+nth+")").addClass("scroll_li_active").siblings().removeClass("scroll_li_active");
      var tx_start_time=$("input[name='tx_start_time_hi']").val();var m=(parseInt(d_top/36)+3)%60;
      $("input[name='tx_start_time_hi']").val(tx_start_time.split(":")[0]+":"+(m<10?"0"+m:m));  
   });
 
   //绑定点击事件
   $("body").on("click",".modal_confirm_div",function(){ 
      var info_lable=$("input[name=info_lable]").val();
      if("穿刺方式"==info_lable){
         var flag=0;
         $("div.modal_content>button.btn_active").each(function(){
           if($(this).text().indexOf("绳梯法")>=0){
		      flag=1;
	       }
		 });
		 if(flag==1){
		   $("tr.tx_tlpic").addClass("hidden");
           $("tr.tx_ccfx").removeClass("hidden");
           $("tr.tx_ccwd").removeClass("hidden");
		 }else{
		   $("tr.tx_ccwd").addClass("hidden");
           $("tr.tx_ccfx").removeClass("hidden");
           $("tr.tx_tlpic").removeClass("hidden");
		 }
      }
   });
   
   
   
   var xgtl_ccwd_page=null;
    $("body").on("click",".xgtl_ccwd_page",function(){ 
       xgtl_pic_page=layer.open({
	        type: 2,
			title: false,
			closeBtn: 0,
			anim: 2,
			shadeClose: false,
			skin:'layui-layer-mtxform',
			area: ['100%', '100%'],
			content:'txform/mtxform_xgtlccwd.shtml?tx_number=${param.tx_number}',
			success: function(layero){
               $(layero).addClass("scroll-wrapper");//苹果 iframe 滚动条失效解决方式
            } 
	   });
   });
  
 });
	
		// 显示通路图片
  		var tx_number = '${param.tx_number}';
  		var user_id = '${user_id.substring(0, 4)}';
  		$("#tx_form").on("click.viewpic","#viewMarkPic",function(){
  			var pic_view = $("#view-markpic-wrap");
  			var src = 'https://biangene.oss-cn-shenzhen.aliyuncs.com/xgtl/${user_id.substring(0, 4)}/${param.tx_number}.png?tag='+parseInt(Math.random()*1000);
  			pic_view.find("img").attr("src",src);
  			pic_view.find("img").attr("onerror","this.src='https://biangene.oss-cn-shenzhen.aliyuncs.com/xgtl/1162/default.png?v=20180126';xgtlImgLoadError();")
  			
  			
  			$.post("xgtl/listxgtlwdt.shtml",{"tx_number":tx_number},function(res){
  				if(res.status.length == 0){
					return
				}
  				$("#point_mark_img_wrap1").find("div").remove()
				var mark_data = JSON.parse(res.status[0].tx_xgtl_text),			
				 	mark_A = mark_data.A,
				 	mark_V = mark_data.V,
				 	mark_T = mark_data.T;
				if(mark_A.length == 0 && mark_V == 0){
					return
				}
				
				mark_A.map(function (i, v) {
					var tag_span_a1 = '<span class="mark-line mark-line-a" style="transform: rotate(' + i.rotate +
						'deg);" data-rotate="' + i.rotate + '"></span>';
					var num = parseInt(i.markNum);
					var markDom = '<div class="mtx-mark-tag mark-target-a mark-target-a' + num + '" data-num=' + num +
						' style="position:absolute;left:' + i.left + 'px;top:' + i.top + 'px;">' + num + tag_span_a1 + '</div>';
						//console.log(markDom)
					$(markDom).appendTo($("#point_mark_img_wrap1"));
				})
	
				mark_V.map(function (i, v) {
					//console.log(i)
					var tag_span = '<span class="mark-line mark-line-v" style="transform: rotate(' + i.rotate +
						'deg);" data-rotate="' + i.rotate + '"></span>';
					var num = parseInt(i.markNum);
					var markDom = '<div class="mtx-mark-tag mark-target-v mark-target-v' + num + '" data-num=' + num +
						' style="position:absolute;left:' + i.left + 'px;top:' + i.top + 'px;">' + num + tag_span + '</div>';
					$(markDom).appendTo($("#point_mark_img_wrap1"));
				})
	
				mark_T.map(function (i, v) {
					//console.log(i)
					var markDom = '<div class="add-mark-text-wrap" style="position:absolute;left:' + i.left + '%;top:' + i.top + '%;width:'+i.w+'%;">'
									+	'<input type="text"  class="mark-text-ipt" value="'+ i.text +'" readonly="true" style="width:'+ i.width +'px;">'
									+	'<span class="mark-text-line" style="transform: rotate(' + i.rotate + 'deg);" data-rotate="' + i.rotate + '"></span>'
									+'</div>'	
					$(markDom).appendTo($("#point_mark_img_wrap1"));
				})
				var initScale = $("#tx_form").width() / 610;
				
				var scale = $("#point_mark_img_wrap1").outerWidth() / 610 || initScale; //PC端的宽度为600，计算缩放比例
				//console.log($("#tx_form").width(),$("#point_mark_img_wrap1").width())
				$("#point_mark_img_wrap1 .mtx-mark-tag").each(function (i, v) {
					var $that = $(this),
						width = parseInt($that.width()) * scale,
						height = parseInt($that.height()) * scale,
						left = parseInt($that.position().left) * scale,
						top = parseInt($that.position().top) * scale;
					$that.css({
						"left": left + "px",
						"top": top + "px",
						"width": width + "px",
						"height": height + "px",
						"line-height": height + "px",
						"border-radius": height / 2 + "px"
					})
					
					var $line = $that.find(".mark-line");
					$line.css({
						"width": $line.width() * scale,
						"transform": "rotate(" + $line.data("rotate") + "deg)"
					})
					if(scale < 0.7 ){
						$that.css({
							"font-size": "14px",
							"transform": "scale(1.2,1.2)"
						})
						$line.css({
							"transform": "rotate(" + $line.data("rotate") + "deg) scale(0.8333)"
						})
					}
					if(scale > 1 ){
						$that.css({
							"font-size": "24px"
						})
						$line.css({
							"transform": "rotate(" + $line.data("rotate") + "deg)"
						})
					}
				})
				
				$("#point_mark_img_wrap1 .add-mark-text-wrap").each(function (i, v) {
					//console.log(v)
					var $that = $(this),
						width = parseInt($that.width()) * scale,
						height = parseInt($that.height()) * scale;
					$that.css({
						/* "width": width + "px", */
						"height": height + "px"
					})
					
					var $line = $that.find(".mark-text-line");
					$line.css({
						"width": $line.width() * scale,
						"transform": "rotate(" + $line.data("rotate") + "deg)"
					})
				})
  			})
  			pic_view.css("display","flex");
  			pic_view.on("touchstart", "div,img",function (e) {
  				e.stopPropagation();
	            //e.preventDefault(); //阻止触摸时页面的滚动，缩放
  			})
  			$("#markpicWarp2 .close-view-img_ , div.shadow").click(function(){
  				$("#view-markpic-wrap div.mtx-mark-tag , #view-markpic-wrap .add-mark-text-wrap").remove()
  				pic_view.css("display","none");
  			})
  		})
  		
  		function xgtlImgLoadError(){
  			layer.msg("暂无通路图片")
  		} 
	</script>
</html>